package com.bytedance.social.controller;

import com.bytedance.social.request.CommentActionRequest;
import com.bytedance.social.request.CommentListRequest;
import com.bytedance.social.respones.CommentActionResponse;
import com.bytedance.social.respones.CommentListResponse;
import com.bytedance.social.service.CommentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/douyin/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;


    @PostMapping("/action")
    public CommentActionResponse userCommentAction(CommentActionRequest commentActionRequest) {
        CommentActionResponse commentActionResponse = commentService.userCommentAction(commentActionRequest);
        return commentActionResponse;
    }


    @GetMapping("/list")
    public CommentListResponse getVideoComments(CommentListRequest commentListRequest) {
        CommentListResponse commentListResponse = commentService.getVideoComments(commentListRequest);
        return commentListResponse;
    }

}
